package com.ssy.jt808.gateway.sdk.terminal.constant.location.addition;

import java.util.Map;
import java.util.TreeMap;

/**
 * 超速告警位置类型枚举
 *
 * @author wangzezhou
 */
public enum OverSpeedAreaEnum{

  /** 无特定位置 */
  NoSpecificLocation(0),
  /** 圆形区域 */
  CircularArea(1),
  /** 矩形区域 */
  RectangularArea(2),
  /** 多边形区域 */
  PolygonalArea(3),
  /** 路径 */
  Route(4),
  ;

  OverSpeedAreaEnum( int type ){
    this.type = type;
  }

  private final int type;

  public int areaType(){
    return this.type;
  }


  private static final Map<Integer,OverSpeedAreaEnum> TYPE_MAP;

  static {
    TYPE_MAP = new TreeMap<>();
    OverSpeedAreaEnum[] values = values();
    for(OverSpeedAreaEnum value : values){
      TYPE_MAP.put(value.areaType(), value);
    }
  }

  public static OverSpeedAreaEnum areaType( int type ){
    OverSpeedAreaEnum overSpeedAreaEnum = TYPE_MAP.get(type);
    assert overSpeedAreaEnum!=null;
    return overSpeedAreaEnum;
  }
}
